<?php
namespace app\api\controller;
/**
 * Created by PhpStorm.
 * Power By Mikkle
 * Email：776329498@qq.com
 * Date: 2017/10/31
 * Time: 20:26
 */

use think\Controller;


// 空控制器
class Error extends Base {
    // 空操作
    protected $api_config=[];
    public function _empty(){
        $action = $this->request->action();
        $this->api_config=Config::get("api_{$this->request->controller()}");
        if (isset($this->config_list[$action])){
            $action_name = $this->api_config[$action]['action_name'];
            //判断api_config中定义执行的方法是否存在
            if( method_exists($this,$action_name)){
                return $this->$action_name($action);
            }else{
                return self::showJsonReturnCodeWithOutData(1002);
            }
        }else{
            return self::showJsonReturnCodeWithOutData(1003,"参数错误");
        }
    }
}
